<template>
    <div>
        <detail-banner :bannerImg="bannerImg" :sightName="sightName" :gallaryImgs="gallaryImgs"></detail-banner>
        <detail-header></detail-header>
        <detail-list :categoryList="categoryList"></detail-list>
        <div class="ll"></div>
    </div>
</template>
<script>
import DetailBanner from './components/Banner'
import DetailHeader from './components/Header'
import DetailList from './components/List'
import axios from 'axios'
export default {
  name: 'Detail',
  components: {
    DetailBanner,
    DetailHeader,
    DetailList
  },
  data () {
    return {
      bannerImg: '',
      sightName: '',
      gallaryImgs: [],
      categoryList: []
    }
  },
  methods: {
    getData () {
      axios.get('api/detail.json', {id: this.$route.params.id}).then((res) => {
        let result = res.data
        if (result.ret && result.data) {
          this.bannerImg = result.data.bannerImg
          this.sightName = result.data.sightName
          this.gallaryImgs = result.data.gallaryImgs
          this.categoryList = result.data.categoryList
        }
      })
    }
  },
  mounted () {
    this.getData()
  }
}
</script>
<style lang="stylus" scoped>
.ll
  height 8rem
</style>
